Skip to content

feat(project): add resource usage summaries#4429

Open
cromulus wants to merge 3 commits into
Dokploy:canaryfrom
cromulus:feat/project-resource-utilization
Open

feat(project): add resource usage summaries#4429
cromulus wants to merge 3 commits into
Dokploy:canaryfrom
cromulus:feat/project-resource-utilization

Conversation

@cromulus

@cromulus cromulus commented May 19, 2026

Copy link
Copy Markdown

Summary

Adds project- and service-level resource usage summaries for self-hosted Dokploy instances.

  • Adds a project.resourceMetrics tRPC query gated by the existing monitoring read permission.
  • Aggregates Docker CPU, memory, block I/O, and network I/O by Dokploy service and project across configured servers.
  • Displays compact usage strips with CPU sparklines on project cards, environment service cards, service detail headers, and a service monitoring tab.
  • Stores a short local metrics history under the existing monitoring path so sparklines can render over time.
  • Hardens collection so one unavailable Docker server returns stale/unavailable summaries instead of failing the whole query or recording false zeroes.

Notes

  • Disk shown in this first pass is Docker block I/O read/write, not persistent volume capacity usage.
  • History is sampled when the UI requests metrics, matching the current on-demand monitoring pattern rather than adding a background collector.
  • The endpoint is disabled for cloud deployments and respects project, environment, and service access filters for non-admin members.
  • For multi-node swarm clusters, Docker stats still come from the Docker engine being queried; this matches Dokploy's existing monitoring limitation rather than introducing a cluster-wide collector.

Validation

  • ASDF_NODEJS_VERSION=24.14.1 ASDF_PNPM_VERSION=10.17.1 pnpm exec biome check apps/dokploy/__test__/resource-metrics/resource-metrics.test.ts apps/dokploy/components/dashboard/resource-metrics/usage-strip.tsx apps/dokploy/server/api/routers/project.ts packages/server/src/services/resource-metrics.ts
  • ASDF_NODEJS_VERSION=24.14.1 ASDF_PNPM_VERSION=10.17.1 pnpm --filter=dokploy run typecheck
  • ASDF_NODEJS_VERSION=24.14.1 ASDF_PNPM_VERSION=10.17.1 pnpm --filter=server run typecheck
  • ASDF_NODEJS_VERSION=24.14.1 ASDF_PNPM_VERSION=10.17.1 pnpm --filter=dokploy exec vitest --config __test__/vitest.config.ts --run __test__/resource-metrics/resource-metrics.test.ts
  • ASDF_NODEJS_VERSION=24.14.1 ASDF_PNPM_VERSION=10.17.1 pnpm --filter=dokploy exec vitest --config __test__/vitest.config.ts --run --exclude __test__/deploy/application.real.test.ts

@cromulus cromulus force-pushed the feat/project-resource-utilization branch from c4c5051 to 32c4318 Compare June 23, 2026 15:12
@cromulus cromulus marked this pull request as ready for review June 23, 2026 15:12
@cromulus cromulus requested a review from Siumauricio as a code owner June 23, 2026 15:12
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant